import QtQuick 2.0

Item {
    id:disc
    state:"pause"
    states:[
        State{
            name:"play"
            PropertyChanges { target: rotation;angle:360}
        },
        State{
            name:"pause"
            PropertyChanges{target:rotation;angle:290}
        }
    ]
    transitions: [
        Transition {
            from: "play";to: "pause"
            PropertyAnimation{
                target:rotation
                property: "angle"
                duration:400
            }
        },
        Transition {
            from: "pause";to: "play"
            PropertyAnimation{
                target:rotation
                property: "angle"
                duration: 400
            }
        }
    ]
    Rectangle{
        id:imgDisc
        width:disc.width
        height:disc.width
        BorderImage {
            source: "qrc:images/default_disc_720.jpg"
            width: imgDisc.width
            height: imgDisc.height
            border.left: 0
            border.top: 0
            border.right: 0
            border.bottom: 0
        }
    }
    Image{
        id:needle
        x:disc.width/2-35
        y:-35
        source: "qrc:images/play_needle.png"
        sourceSize:Qt.size(120,180)
        transform:rotation
    }

    Rotation{id:rotation;origin.x:35;origin.y:35}
}
